<template>
  <div class="quoteCard">
    <div class="container">
      <div class="content">
        <div class="img">
          <el-image :src="src" alt class="img" />
        </div>
        <div class="primary">
          <div
            class="Individual"
            v-for="(item,index) in list"
            :key="index"
            @mouseenter="enter(item)"
          >
            <div class="primaryTitle">
              <a :href="item.linkUrl">
                <p>{{item.title}}</p>
              </a>
            </div>
            <div class="primaryTime">
              <p>{{item.gmtCreated | formatDate}}</p>
            </div>
            <el-divider></el-divider>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { formatDate } from "../../utils/tools";
export default {
  props: {
    articleList: Array
  },
  data() {
    return {
      list: [],
      src: ""
    };
  },
  methods: {
    enter(item) {
      this.src = item.coverImgUrl;
    }
  },
  watch: {
    articleList(val) {
      this.list = val;
      this.src = this.list[0].coverImgUrl;
    }
  },
  filters: {
    formatDate(time) {
      let date = new Date(time);
      return formatDate(date, "yyyy-MM-dd hh:mm");
    }
  }
};
</script>

<style>
.quoteCard {
  width: 100%;
  margin: 0px auto;
}

.quoteCard .container {
  background: #fff;
  width: 100%;
  height: 370px;
}
.quoteCard .container .content {
  width: 90%;
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
}
.quoteCard .container .content .img {
  width: 400px;
  line-height: 300px;
  height: 300px;
}
.quoteCard .container .content .img img {
  display: block;
  width: 100%;
  height: 100%;
}
.quoteCard .container .content .primary {
  width: 60%;
  /* line-height: 300px;
  height: 300px; */
}
/* .quoteCard .container .content .primary .Individual {
  height: 75px;
} */
.quoteCard .container .content .primary .Individual p:hover {
  cursor: pointer;
  color: #ffc310 !important;
}
.quoteCard .container .content .primary .Individual .primaryTitle p {
  /* height: 29px; */
  font-size: 17px;
  text-align: left;
  color: rgba(0, 0, 0, 1);
  line-height: 29px;
  margin-left: 15px;
  margin-right: 15px;
}
.quoteCard .container .content .primary .Individual .primaryTime p {
  height: 23px;
  font-size: 14px;
  text-align: left;
  color: rgba(156, 156, 156, 1);
  font-weight: 400;
  line-height: 23px;
  text-align: left;
  margin-left: 15px;
  margin-bottom: 10px;
}
.el-divider--horizontal {
  margin: 0 !important;
}
@media screen and (max-width: 1181px) {
  .quoteCard .container .content .primary {
    width: 100%;
  }
}
@media screen and (max-width: 911px) {
  .quoteCard .container .content {
    width: 100%;
  }
}
@media screen and (max-width: 846px) {
  .quoteCard .container .content .primary .Individual .primaryTitle p {
    font-size: 15px;
  }
}
@media screen and (max-width: 736px) {
  .quoteCard .container .content .primary .Individual .primaryTitle p {
    font-size: 15px;
  }
  .quoteCard .container .content {
    display: block;
    width: 90%;
    margin: 0 auto;
  }
  .quoteCard .container .content .img {
    width: 100%;
  }
  .quoteCard .container .content .img img {
    padding: 0;
  }
  .quoteCard .container {
    height: auto;
  }
}
@media screen and (max-width: 586px) {
  .quoteCard .container .content {
    display: block;
    width: 90%;
    margin: 0 auto;
  }
}
@media screen and (max-width: 539px) {
  .quoteCard .container .content .primary {
    height: auto;
    line-height: auto;
  }
  .quoteCard .container .content .primary .Individual {
    height: 70px;
  }
  .quoteCard .container .content .primary .Individual .primaryTitle p {
    font-size: 14px;
  }
  .quoteCard .container .content .primary .Individual {
    height: auto;
  }
  .quoteCard .container .content .primary .Individual .primaryTitle p {
    height: auto;
  }
}
@media screen and (max-width: 475px) {
  .quoteCard .container .content .img {
    height: 200px;
  }
}
</style>